#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QMenuBar* menuBar = new QMenuBar();
    this->setMenuBar(menuBar);
    QMenu* menu1 = new QMenu("文件 (&F)");
    menuBar->addMenu(menu1);
    QAction* action1 = new QAction("新建");
    QAction* action2 = new QAction("保存");
    // 给菜单项添加 分隔符
    menu1->addAction(action1);
    menu1->addSeparator();
    menu1->addAction(action2);
}

MainWindow::~MainWindow()
{
    delete ui;
}

